import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const queryBizPlanManage = (params) => {
  params.head.transCode = 'queryBizPlanManage';
  return request({
    url: '/biz/plan/bizPlanManage/queryBizPlanManage',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const queryBizPlanManageListPage = (params) => {
  params.head.transCode = 'queryBizPlanManageListPage';
  return request({
    url: '/biz/plan/bizPlanManage/queryBizPlanManageListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveBizPlanManage = (params) => {
  params.head.transCode = 'saveBizPlanManage';
  return request({
    url: '/biz/plan/bizPlanManage/saveBizPlanManage',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveBizPlanManageList = (params) => {
  params.head.transCode = 'saveBizPlanManageList';
  return request({
    url: '/biz/plan/bizPlanManage/saveBizPlanManageList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateBizPlanManage = (params) => {
  params.head.transCode = 'saveOrUpdateBizPlanManage';
  return request({
    url: '/biz/plan/bizPlanManage/saveOrUpdateBizPlanManage',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateBizPlanManageList = (params) => {
  params.head.transCode = 'saveOrUpdateBizPlanManageList';
  return request({
    url: '/biz/plan/bizPlanManage/saveOrUpdateBizPlanManageList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateBizPlanManage = (params) => {
  params.head.transCode = 'updateBizPlanManage';
  return request({
    url: '/biz/plan/bizPlanManage/updateBizPlanManage',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteBizPlanManage = (params) => {
  params.head.transCode = 'deleteBizPlanManage';
  return request({
    url: '/biz/plan/bizPlanManage/deleteBizPlanManage',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteBizPlanManageList = (params) => {
  params.head.transCode = 'deleteBizPlanManageList';
  return request({
    url: '/biz/plan/bizPlanManage/deleteBizPlanManageList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportBizPlanManageExcel = (params) => {
  downloadExcel({
    url: '/biz/plan/bizPlanManage/excelDownload/exportBizPlanManageExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
